<template>
	<view v-if="is_init">
		<uni-popup-input name="提示" @close="on_close">
			<view  class="banmi_flex a-c j-c " style="width: 100%;height: 60vh;">
				  {{msg}}
			</view>
		</uni-popup-input>
	</view>
</template>

<script>
	import {
		buildMenus,
		getParents,
		patTree,
		getSortMenu
	} from '@/components/uni-data-menu/util.js'

	export default {
		components: {

		},
		props: {

		},
		data() {
			return {
				find: {},
				up_find: {},
				uid: 0,
				is_init: false,
				nav_list: [],
				img_url: '',
				menu_list: [],
				nav_id: 0,
				list_nav: [],
				msg:''

			}
		},

		methods: {
			async init(msg) {
				this.msg=msg
				this.is_init = true;
			},
			on_renewal(catalogue) {
				if (this.v_update == 2) {
					uni.showToast({
						title: '该用于未在官方上架',
						icon: 'error'
					})
					return
				}

				this.$refs.alertDialog.open()
			},
			on_up(index) {
				this.version = this.find.version;
				this.catalogue = this.find.catalogue;
				uni.request({
					url: this.detectionUpdate,
					data: {
						version: this.version,
						system_url: uni.getStorageSync('pc_web'),
						catalogue: this.catalogue,
						locationhref: this.locationhref,
						find: JSON.stringify(this.find),
						config: JSON.stringify(this.config)
					},
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					timeout: 30000,
					method: 'POST',
					dataType: 'json',
					token: false,
					success: (res) => {
						if (res) {
							if (res.data.data.update == 2) {
								this.v_update = 2;
								return
							}
							this.wx_applet = res.data.data.wx_applet;
							this.up_find = res.data.data.find;
							this.up_find['version'] = this.version;
							this.up_find['p_id'] = this.find.id;
							this.up_find['catalogue'] = this.find.catalogue;
							this.up_find.content = this.up_find.content.replace(/&emsp;/g, " ")
							if (this.up_find.type == 1 && this.up_find.update == 1) {
								this.$refs.alertDialog.open()
							}
							if (index == 1) {
								this.$refs.alertDialog.open()
							}
						}
					},
					fail: (error) => {


					}
				});

			},
			on_close() {
				this.find = {}
				this.is_init = false;
			},
			//js分类方法

		}
	}
</script>

<style>
	/* 	button::after {
		border: none;
	} */

	.top_head {
		background-color: #F8F8F8;
		width: 100%;
		top: 0;
		left: 0;
		z-index: 999;
		position: sticky
	}

	.but {
		width: 120rpx;
		height: 100rpx;
		padding: 0;
		border: 0;
		background-color: transparent;
		outline: none;
	}

	button {
		padding: 0;

		/* 	background: transparent; */
	}

	.top_but {
		background-color: #F8F8F8;
		width: 100%;
		height: 100rpx;
		top: 0;
		left: 0;
		z-index: 999;
		position: sticky
	}

	.zu_but {
		position: fixed;
		height: 100rpx;
		z-index: 999;
		background-color: #F8F8F8;
		bottom: 288rpx;
	}

	.option_box {
		width: 35rpx;
		height: 35rpx;
		border: 1rpx solid #999999;
		border-radius: 5px;
		margin-right: 10rpx;
		// background-color: #FF852A;
		display: flex;
		justify-content: center;
		align-items: center;

		image {
			width: 20rpx;
			height: 20rpx;
		}
	}

	.option_box_active {
		background: linear-gradient(-30deg, #ff7029 0%, #faa307 100%);
		border: 1rpx solid #faa307 !important;
	}

	.sub_btn_add {
		margin-left: 30rpx;
		width: 150rpx;
		height: 60rpx;
		background: linear-gradient(-30deg, #A9A9A9 0%, #A9A9A9 100%);
		border-radius: 44rpx;

		font-size: 30rpx;
		font-weight: 700;
		color: #ffffff;

		line-height: 60rpx;
	}

	.sub_btn {

		height: 70rpx;
		width: 100rpx;
		background: #0071FE;
		border-radius: 10rpx;
		font-size: 30rpx;
		color: #ffffff;
		line-height: 70rpx;
	}
</style>